Optimal. Leaf size=612 \[ \frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \text {ArcTan}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {b \tanh ^{-1}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 23.22, antiderivative size = 612, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 12, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {3781, 6857,
746, 857, 635, 212, 738, 1004, 1050, 1044, 211, 214} \begin {gather*} \frac {\sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \text {ArcTan}\left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-\left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}+\frac {\sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \tanh ^{-1}\left (\frac {\left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \tan (d+e x)+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} e \sqrt [4]{a^2-2 a c+b^2+c^2}}-\frac {b \tanh ^{-1}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 212
Rule 214
Rule 635
Rule 738
Rule 746
Rule 857
Rule 1004
Rule 1044
Rule 1050
Rule 3781
Rule 6857
Rubi steps
\begin {align*} \int \cot ^2(d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)} \, dx &=\frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{x^2 \left (1+x^2\right )} \, dx,x,\tan (d+e x)\right )}{e}\\ &=\frac {\text {Subst}\left (\int \left (\frac {\sqrt {a+b x+c x^2}}{x^2}+\frac {\sqrt {a+b x+c x^2}}{-1-x^2}\right ) \, dx,x,\tan (d+e x)\right )}{e}\\ &=\frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{x^2} \, dx,x,\tan (d+e x)\right )}{e}+\frac {\text {Subst}\left (\int \frac {\sqrt {a+b x+c x^2}}{-1-x^2} \, dx,x,\tan (d+e x)\right )}{e}\\ &=-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}+\frac {\text {Subst}\left (\int \frac {b+2 c x}{x \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 e}+\frac {\text {Subst}\left (\int \frac {a-c+b x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e}-\frac {c \text {Subst}\left (\int \frac {1}{\sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e}\\ &=-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}+\frac {b \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 e}+\frac {c \text {Subst}\left (\int \frac {1}{\sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{e}-\frac {(2 c) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}-\frac {\text {Subst}\left (\int \frac {b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )-b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 \sqrt {a^2+b^2-2 a c+c^2} e}+\frac {\text {Subst}\left (\int \frac {b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )+b \sqrt {a^2+b^2-2 a c+c^2} x}{\left (-1-x^2\right ) \sqrt {a+b x+c x^2}} \, dx,x,\tan (d+e x)\right )}{2 \sqrt {a^2+b^2-2 a c+c^2} e}\\ &=-\frac {\sqrt {c} \tanh ^{-1}\left (\frac {b+2 c \tan (d+e x)}{2 \sqrt {c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}-\frac {b \text {Subst}\left (\int \frac {1}{4 a-x^2} \, dx,x,\frac {2 a+b \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {(2 c) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {\left (b \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right )-b x^2} \, dx,x,\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}+\frac {\left (b \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-2 b \sqrt {a^2+b^2-2 a c+c^2} \left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right )-b x^2} \, dx,x,\frac {-b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{e}\\ &=\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \tan ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {b \tanh ^{-1}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{2 \sqrt {a} e}+\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \tanh ^{-1}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) \tan (d+e x)}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} e}-\frac {\cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{e}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.20, size = 261, normalized size = 0.43 \begin {gather*} -\frac {\frac {b \tanh ^{-1}\left (\frac {2 a+b \tan (d+e x)}{2 \sqrt {a} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )}{\sqrt {a}}-i \sqrt {a-i b-c} \tanh ^{-1}\left (\frac {2 a-i b+(b-2 i c) \tan (d+e x)}{2 \sqrt {a-i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )+i \sqrt {a+i b-c} \tanh ^{-1}\left (\frac {2 a+i b+(b+2 i c) \tan (d+e x)}{2 \sqrt {a+i b-c} \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}\right )+2 \cot (d+e x) \sqrt {a+b \tan (d+e x)+c \tan ^2(d+e x)}}{2 e} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] result has leaf size over 500,000. Avoiding possible recursion issues.
time = 20.03, size = 1170542, normalized size = 1912.65
method | result | size |
default | \(\text {Expression too large to display}\) | \(1170542\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \tan {\left (d + e x \right )} + c \tan ^{2}{\left (d + e x \right )}} \cot ^{2}{\left (d + e x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\mathrm {cot}\left (d+e\,x\right )}^2\,\sqrt {c\,{\mathrm {tan}\left (d+e\,x\right )}^2+b\,\mathrm {tan}\left (d+e\,x\right )+a} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________